﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
using System.Data;
using Xiaov.SmartWeb.Application.SupCan;

namespace Xiaov.SmartWeb.Application.StatisticsReport.YT_TZZB2
{
    public partial class YT_TZZB2Data : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                string nf = Request.QueryString["nf"];
                string yf = Request.QueryString["yf"];
                string dwbm = Request.QueryString["dwbm"];
                string dataString = ConfigurationManager.AppSettings["YTTZZB2_Column"];
                string sql = "select a.dwbm,a.nf,a.yf,a.ljjsje," + dataString + @",b.ljjsje cjljjsje,c.ljjsje jxljjsje,d.ljjsje ljljjsje,e.ljjsje zjljjsje,f.ljjsje jgcljjsje from v_cj_yt_tzzb_cx a 
                    left join v_zy_cjjsje b on a.nf=b.nf and a.yf=b.yf and a.px=b.gcpx and a.dwbm=b.dwbm 
                    left join v_zy_jxjsje c on a.nf=c.nf and a.yf=c.yf and a.px=c.gcpx and a.dwbm=c.dwbm 
                    left join v_zy_ljjsje d on a.nf=d.nf and a.yf=d.yf and a.px=d.gcpx and a.dwbm=d.dwbm 
                    left join v_zy_zjjsje e on a.nf=e.nf and a.yf=e.yf and a.px=e.gcpx and a.dwbm=e.dwbm 
                    left join v_zy_jgcjsje f on a.nf=f.nf and a.yf=f.yf and a.px=f.gcpx  and a.dwbm=f.dwbm 
                    where a.nf=" + nf + " and a.yf=" + yf + " and a.dwbm='" + dwbm + "' and a.xmgcid_lb<>'专业' order by a.pxbm";
                DataSet ds = Maticsoft.DBUtility.DbHelperOra.Query(sql);
              
                ConvertToXml.Convert(ds.Tables[0], dataString + ",dwbm,nf,yf,ljjsje,zjljjsje,cjljjsje,ljljjsje,jxljjsje,jgcljjsje", 0, ds.Tables[0].Rows.Count);
            }
        }
    }
}